Issue 2774: Changed the implementation of isVolumeOnManagedStorage(VolumeInfo) to…#2776
Conversation
| @@ -196,10 +196,16 @@ public StrategyPriority canHandle(DataObject srcData, DataObject destData) { | |||
| } | |||
|
|
|||
| private boolean isVolumeOnManagedStorage(VolumeInfo volumeInfo) { | |||
There was a problem hiding this comment.
What about a unit test here?
There was a problem hiding this comment.
@DaanHoogland is planning on writing a unit test for the higher-level canHandle method (to add to this PR).
There was a problem hiding this comment.
yes, I am. I am struggling with the large number of injects but I think the canHandle() should be tested indeed, as the error was because the strategy returned a wrong priority from that call.
There was a problem hiding this comment.
That is why we should unit test methods instead. We need to reduce the test code. Otherwise it becomes almost impossible to maintain them.
There was a problem hiding this comment.
sorry, I'm missing your point
There was a problem hiding this comment.
@mike-tutkowski are you going to add some unit test(s)? this is ready for merging otherwise.
There was a problem hiding this comment.
@rhtyd I believe @rafaelweingartner noted (perhaps on the mailing list) that he would like to add one unit test to this PR before it is merged. Thanks
There was a problem hiding this comment.
Also, I think @DaanHoogland was planning on adding a unit test, as well.
There was a problem hiding this comment.
@mike-tutkowski Daan has already sent a PR to add unit test to your branch, can you merge that. See mike-tutkowski#6
There was a problem hiding this comment.
@mike-tutkowski the PR I said I wanted to create some unit tests is not this one, it is the other one I worked.
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2212 |
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2893)
|
borisstoyanov
left a comment
There was a problem hiding this comment.
LGTM, failed tests are already addressed in separate PRs.
|
OK, thanks for the clarification, Rafael.
I will look at Daan’s unit test today.
On Aug 9, 2018, at 5:09 AM, Rafael Weingärtner <notifications@github.com<mailto:notifications@github.com>> wrote:
@rafaelweingartner commented on this pull request.
________________________________
In engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java<#2776 (comment)>:
@@ -196,10 +196,16 @@ public StrategyPriority canHandle(DataObject srcData, DataObject destData) {
}
private boolean isVolumeOnManagedStorage(VolumeInfo volumeInfo) {
@mike-tutkowski<https://github.com/mike-tutkowski> the PR I said I wanted to create some unit tests is not this one, it is the other one I worked.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2776 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AC4SH5gYYsN-hRc7V2cgpLyM9rzQUP3Kks5uPBgsgaJpZM4ViYUg>.
|
d937cbf to
0378f84
Compare
… check if the data store in question is for primary storage (and added a unit test from Daan Hoogland)
0378f84 to
ab83c19
Compare
|
Two LGTMs and tests look good. Merging this into 4.11. |
|
@DaanHoogland Do you know what process I should follow to merge this forward into master? Thanks |
|
there is a tool in tools/git called git-fwd-merge (i think). You should use that to merge 4.11 on master and than push it to origin. Make sure you have pulled both branches first, @mike-tutkowski ;) |
|
@DaanHoogland I performed the merge to master from 4.11. Can you take a look at 46c56ea and double check that I did it properly? Thanks! |
|
@DaanHoogland Just looking at how a couple other 4.11-to-4.12 merges were handled, it looks like I did the right thing with my merge. |
|
ok, ignoring then ... ;) |
… check if the data store in question is for primary storage
Description
In the StorageSystemDataMotionStrategy.isVolumeOnManagedStorage(VolumeInfo) method, we should have been checking if the DataStore associated with the VolumeInfo was on primary storage before checking if it is managed storage.
Types of changes
GitHub Issue/PRs
Fixes: #2774
How Has This Been Tested?
Regression testing
Checklist:
Testing